/*
 * Copyright (c) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "timeline_module_test.h"

#include <iostream>
#include <chrono>
#include <thread>
#include <gtest/gtest.h>
#include <if_system_ability_manager.h>
#include <ipc_skeleton.h>
#include <string_ex.h>

#include "sensor_if.h"
#include "timeline_common.h"
#include "timeline_client.h"
#include "timeline_manager.h"

using namespace testing::ext;
using namespace OHOS::Msdp;
using namespace OHOS;
using namespace std;
    
void TimelineMoudleTest::TimelineMoudleTestCallback::OnTimelineChanged(const TimelineDataUtils::TimelineData& timelineData)
{
    GTEST_LOG_(INFO) << "TimelineMoudleTestCallback area: " << timelineData.area;
    GTEST_LOG_(INFO) << "TimelineMoudleTestCallback value: " << timelineData.value;
    //EXPECT_EQ(true, timelineData.area == TimelineDataUtils::TimelineArea::AREA && timelineData.value == TimelineDataUtils::TimelineValue::VALUE_ENTER) << "TimelineMoudleTestCallback falied";
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback001, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback001: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    int32_t resttimestart_ = 19;
    int32_t resttimeend_ = 8;
    timelineClient.SetRestTime(resttimestart_, resttimeend_);
    auto type = TimelineDataUtils::TimelineArea::AREA_HOME;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback001: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback002, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback002: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    int32_t worktimestart_ = 9;
    int32_t worktimeend_ = 17;
    timelineClient.SetWorkTime(worktimestart_, worktimeend_);
    auto type = TimelineDataUtils::TimelineArea::AREA_COMPANY;
    timelineClient.Subscribe(type, cb);
    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback002: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback003, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback003: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    auto type = TimelineDataUtils::TimelineArea::AREA_UNKNOWN;
    timelineClient.Subscribe(type, cb);    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback003: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback004, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback004: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    int32_t resttimestart_ = 19;
    int32_t resttimeend_ = 8;
    timelineClient.SetRestTime(resttimestart_, resttimeend_);
    auto type = TimelineDataUtils::TimelineArea::AREA_HOME;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback004: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback005, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback005: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    int32_t resttimestart_ = 19;
    int32_t resttimeend_ = 8;
    timelineClient.SetRestTime(resttimestart_, resttimeend_);
    auto type = TimelineDataUtils::TimelineArea::AREA_COMPANY;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback005: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback006, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback006: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    int32_t resttimestart_ = 19;
    int32_t resttimeend_ = 8;
    timelineClient.SetRestTime(resttimestart_, resttimeend_);
    auto type = TimelineDataUtils::TimelineArea::AREA_UNKNOWN;
    timelineClient.Subscribe(type, cb);    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback006: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback007, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback007: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    int32_t worktimestart_ = 9;
    int32_t worktimeend_ = 17;
    timelineClient.SetWorkTime(worktimestart_, worktimeend_);
    auto type = TimelineDataUtils::TimelineArea::AREA_HOME;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback007: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback008, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback008: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    int32_t worktimestart_ = 9;
    int32_t worktimeend_ = 17;
    timelineClient.SetWorkTime(worktimestart_, worktimeend_);
    auto type = TimelineDataUtils::TimelineArea::AREA_COMPANY;
    timelineClient.Subscribe(type, cb);
    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback008: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback009, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback009: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    int32_t worktimestart_ = 9;
    int32_t worktimeend_ = 17;
    timelineClient.SetWorkTime(worktimestart_, worktimeend_);
    auto type = TimelineDataUtils::TimelineArea::AREA_UNKNOWN;
    timelineClient.Subscribe(type, cb);    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback009: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback010, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback010: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = 110;
    double latitude_ = 29;
    timelineClient.SetHomePosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_HOME;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback010: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback011, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback011: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = 110;
    double latitude_ = 29;
    timelineClient.SetHomePosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_COMPANY;
    timelineClient.Subscribe(type, cb);
    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback011: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback012, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback012: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = 110;
    double latitude_ = 29;
    timelineClient.SetHomePosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_UNKNOWN;
    timelineClient.Subscribe(type, cb);    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback012: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback013, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback013: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = -150;
    double latitude_ = 29;
    timelineClient.SetHomePosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_HOME;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback013: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback014, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback014: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = -150;
    double latitude_ = 29;
    timelineClient.SetHomePosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_COMPANY;
    timelineClient.Subscribe(type, cb);
    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback014: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback015, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback015: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = -150;
    double latitude_ = 29;
    timelineClient.SetHomePosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_UNKNOWN;
    timelineClient.Subscribe(type, cb);    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback015: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback016, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback016: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = 70;
    double latitude_ = -45;
    timelineClient.SetHomePosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_HOME;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback016: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback017, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback017: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = 70;
    double latitude_ = -45;
    timelineClient.SetHomePosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_COMPANY;
    timelineClient.Subscribe(type, cb);
    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback017: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback018, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback018: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = 70;
    double latitude_ = -45;
    timelineClient.SetHomePosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_UNKNOWN;
    timelineClient.Subscribe(type, cb);    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback018: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback019, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback019: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = -130;
    double latitude_ = -45;
    timelineClient.SetHomePosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_HOME;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback019: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback020, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback020: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = -130;
    double latitude_ = -45;
    timelineClient.SetHomePosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_COMPANY;
    timelineClient.Subscribe(type, cb);
    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback020: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback021, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback021: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = -130;
    double latitude_ = -45;
    timelineClient.SetHomePosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_UNKNOWN;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback021: fun is end");
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback022, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback022: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = 110;
    double latitude_ = 29;
    timelineClient.SetCompanyPosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_HOME;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback022: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback023, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback023: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = 110;
    double latitude_ = 29;
    timelineClient.SetCompanyPosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_COMPANY;
    timelineClient.Subscribe(type, cb);
    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback023: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback024, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback024: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = 110;
    double latitude_ = 29;
    timelineClient.SetCompanyPosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_UNKNOWN;
    timelineClient.Subscribe(type, cb);    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback024: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback025, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback025: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = -150;
    double latitude_ = 29;
    timelineClient.SetCompanyPosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_HOME;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback025: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback026, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback026: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = -150;
    double latitude_ = 29;
    timelineClient.SetCompanyPosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_COMPANY;
    timelineClient.Subscribe(type, cb);
    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback026: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback027, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback027: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = -150;
    double latitude_ = 29;
    timelineClient.SetCompanyPosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_UNKNOWN;
    timelineClient.Subscribe(type, cb);    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback027: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback028, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback028: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = 70;
    double latitude_ = -45;
    timelineClient.SetCompanyPosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_HOME;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback028: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback029, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback029: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = 70;
    double latitude_ = -45;
    timelineClient.SetCompanyPosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_COMPANY;
    timelineClient.Subscribe(type, cb);
    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback029: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback030, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback030: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = 70;
    double latitude_ = -45;
    timelineClient.SetCompanyPosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_UNKNOWN;
    timelineClient.Subscribe(type, cb);    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback030: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback031, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback031: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = -130;
    double latitude_ = -45;
    timelineClient.SetCompanyPosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_HOME;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback031: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback032, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback032: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = -130;
    double latitude_ = -45;
    timelineClient.SetCompanyPosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_COMPANY;
    timelineClient.Subscribe(type, cb);
    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback032: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback033, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback033: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    double longitude_ = -130;
    double latitude_ = -45;
    timelineClient.SetCompanyPosition(longitude_,latitude_);
    auto type = TimelineDataUtils::TimelineArea::AREA_UNKNOWN;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback033: fun is end");
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback034, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback034: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    timelineClient.SetPositionState(1,0);
    auto type = TimelineDataUtils::TimelineArea::AREA_HOME;
    timelineClient.Subscribe(type, cb);
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback034: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback035, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback035: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    timelineClient.SetPositionState(1,0);
    auto type = TimelineDataUtils::TimelineArea::AREA_COMPANY;
    timelineClient.Subscribe(type, cb);
    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback035: fun is end");
    //sleep(10);
}

/**
 * @tc.name: TimelineMoudleTestCallback
 * @tc.desc: test subscribe
 * @tc.type: FUNC
 */
HWTEST_F (TimelineMoudleTest, TimelineMoudleTestCallback036, TestSize.Level0)
{
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback036: fun is start");
    auto& timelineClient = TimelineClient::GetInstance();
    sptr<ITimelineCallback> cb = new TimelineMoudleTestCallback();
    GTEST_LOG_(INFO) << "Start register";
    timelineClient.SetPositionState(1,0);
    auto type = TimelineDataUtils::TimelineArea::AREA_UNKNOWN;
    timelineClient.Subscribe(type, cb);    
    sleep(10);
    timelineClient.UnSubscribe(type, cb);
    GTEST_LOG_(INFO) << "Cancell register";
    TIMELINE_HILOGD(TIMELINE_MODULE_SERVICE, "TimelineMoudleTestCallback036: fun is end");
    //sleep(10);
}